<!DOCTYPE html>
<html>
<head>
    <title>报价属性选项表</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <form class="form-inline" role="form">
            <div class="form-group">
                <a @click="reset">
                    <i class="fa fa-refresh"></i>
                </a>
            </div>&nbsp;&nbsp;&nbsp;

            <div class="form-group">
                <input type="text" class="form-control input-sm" v-model="q.optionName" placeholder="选项名称">
            </div>&nbsp;&nbsp;&nbsp;
            <a class="btn btn-primary btn-sm " @click="query">
                <i class="fa fa-search"></i>&nbsp;查询</a>
			<#if shiro.hasPermission("quoteAttribute:quoteattributeoption:save")>
            <a class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("quoteAttribute:quoteattributeoption:update")>
            <a class="btn btn-primary btn-sm" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<!--<#if shiro.hasPermission("quoteAttribute:quoteattributeoption:delete")>-->
            <!--<a class="btn btn-primary btn-sm" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>-->
			<!--</#if>-->
    </form>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <input type="hidden" v-model="quoteAttributeOption.optionAttributeId">
            <div class="form-group" v-show="quoteAttributeOption.optionAttributeId==null">
                <div class="col-sm-2 control-label"><span style="color: red">*&nbsp;</span>选项名称</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control input-sm" v-model="optionName" placeholder="选项名称"/>
                </div>
            </div>
            <div class="form-group" v-show="quoteAttributeOption.optionAttributeId!=null">
                <div class="col-sm-2 control-label"><span style="color: red">*&nbsp;</span>选项名称</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionName" placeholder="选项名称" readonly/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否特种纸</div>
                <div class="col-sm-10">
                    <select v-model="quoteAttributeOption.optionValue" class="form-control input-sm">
                        <option value=0>否</option>
                        <option value=1>是</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">选项key</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionKey" placeholder="选项key"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">前端显示</div>
                <div class="col-sm-10">
                    <select v-model="quoteAttributeOption.display" class="form-control input-sm">
                        <option value="true">显示</option>
                        <option value="false">不显示</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">排序</div>
                <div class="col-sm-10">
                    <input type="number" class="form-control input-sm" v-model="quoteAttributeOption.optionSort" placeholder="排序"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">单位</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control input-sm" v-model="quoteAttributeOption.optionUnit" placeholder="单位"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否自翻</div>
                <div class="col-sm-10">
                    <select v-model="quoteAttributeOption.reprints" class="form-control input-sm">
                        <option value=false>否</option>
                        <option value=true>是</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否自定义</div>
                <div class="col-sm-10">
                    <select v-model="quoteAttributeOption.optionCanDefinition" class="form-control input-sm">
                        <option value="false">否</option>
                        <option value="true">是</option>
                    </select>
                </div>
            </div>
            <div class="form-group" v-show="quoteAttributeOption.optionCanDefinition=='true'">
                <div class="col-sm-2 control-label">自定义参数</div>
                <div class="col-sm-10">
                    <div v-for="(item,index) of list">
                        <input type="number" placeholder="最小值" v-model="item[0]"> ~ <input type="number" v-model="item[1]" placeholder="最大值">
                        <input type="button" @click="addOpt" value="+"><input type="button" @click="delOpt(index)" value="-">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">添加克重厚度</div>
                <div class="col-sm-10">
                    <div v-for="(item,index) of gramdepths">
                        <input type="number" placeholder="克重" v-model="item.option_name2"> ~ <input type="number" v-model="item.option_name3" placeholder="厚度">
                        <input type="button" @click="addGramdepth" value="+"><input type="button" @click="delGramdepth(index,item.id,quoteAttributeOption.optionName)" value="-">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <div class="col-sm-10">
                    <span style="color: red">请勿添加重复克重!</span>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary  btn-sm" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/quoteAttribute/quoteattributeoption.js?_${.now?long}"></script>
</body>
</html>